<form action="<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'save_ext_media'));?>" method="post">
<?php
    if ($this->pages) 
    {
?>
<div class="pagination top"><?=$this->pages;?></div>
<?
    }

$numRows = sizeof($this->files);
if ($numRows) {
?>
<table width="100%" cellspacing="0" cellpadding="0" class="edit_block">
<?
    while (list(, $file) = each($this->files)) 
    {
?>
	  <tr> 
<?php 
		if ($this->extId)
		{
?>	   	
		<td class="first" width="1"><input type="checkbox" name="media_id[]" value="<?=$file->GetId();?>"></td>
<?php 
		}
?>
	  	<td<?=(!$this->extId ? ' class="first"' : '');?> width="10%" align="center">
	  		<img src="<?=_ROOT_URL.$this->thumbFolder.$file->GetThumbnail();?>">
	  		<div><?=$file->GetType();?></div>
	  	</td>
		<td class="title">
			<div class="date-block"><?=$file->GetPublishDate();?></div>
			<?php 
				if ($file->GetStatus() != MatchMediaStatus::Ready)
				{
			?>	
			<small style="color: red;"><?=$file->GetStatusName();?></small><br />
			<?php 	
				}	
			?>	
			<?=$file->GetTitle();?>
			<div class="tags-block"><?=$file->GetTags();?></div>
		</td>	
		<td width="1"><a
			href="<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'add_media', 'id' => $file->GetId()));?>"
			title="редактировать"><img
			src="<?=_ROOT_URL;?>files/images/admin/edit_edit.gif" alt="edit"
			title="" width="30" height="11"></a></td>
		<td width="1" class="last"><a
			href="<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'del_media', 'id' => $file->GetId()));?>"
			title="Удалить файл?" class="del"><img
			src="<?=_ROOT_URL;?>files/images/admin/edit_close.gif" alt="close"
			title="" width="9" height="11"></a></td>
	</tr>
<?
    }
?>
 </table>
<?
} else {
    ?>
	нет файлов
<?
}

	if ($this->pages) 
	{
?>
<div class="pagination"><?=$this->pages;?></div>
<?
    }
?>   
<br>
<?php 
		if ($this->extId)
		{
?> 
<table>
	<tr>
		<td class="r"><input type="submit" class="bt" value="Добавить" /></td>
		<td class="l"><input type="button" value="Вернуться" class="bt"
			onClick="window.location.href='<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'out_media', 'ext_id' => 0, 'ext_mod' => ''));?>';" /></td>
	</tr>
</table>
<input type="hidden" name="ext_id" value="<?=$this->extId;?>">
<input type="hidden" name="ext_mod" value="<?=$this->extMod;?>">
<?php 
		}
?>
<div class="bt_area"><input type="button" class="bt" value="Добавить файл"
	onclick="window.location.href='<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'add_media'));?>';" />
</div>
</form>